s14aaf

s14aaf © Numerical Algorithms Group, 2002.

Purpose

S14AAF Gamma function

Synopsis

[fun_value,ifail] = s14aaf(x<,ifail>)

Description

 
 This routine evaluates an approximation to the Gamma function 
 (Gamma)(x). 
 
 There are four possible failures for this routine:
 
      (i) if x is too large, there is a danger of overflow since 
      (Gamma)(x) could become too large to be represented in the 
      machine;
 
      (ii) if x is too large and negative, there is a danger of 
      underflow;
 
      (iii) if x is equal to a negative integer, (Gamma)(x) would
      overflow since it has poles at such points;
 
      (iv) if x is too near zero, there is again the danger of 
                                                           1  
      overflow on some machines. For small x, (Gamma)(x)~= -, and
                                                           x  
      on some machines there exists a range of non-zero but small
      values of x for which 1/x is larger than the greatest 
      representable value.
 

Parameters

s14aaf

Required Input Arguments:

x                                     real

Optional Input Arguments:                       <Default>

ifail                                 integer  -1

Output Arguments:

ifail                                 integer